import {
  createRouter,
  createWebHashHistory,
  createWebHistory,
  createMemoryHistory,
} from "vue-router";

let routes = [
  {
    path: "/",
    component: () => import("../pages/home/index.vue"),
    name: "/",
    meta: {
      name: "导航首页",
    },
    children: [
      {
        path: "discover",
        component: () => import("../pages/discover/index.vue"),
        redirect: "/discover/palylist",
        name: "discover",
        meta: {
          name: "发现",
        },
        children: [
          {
            path: "palylist",
            component: () => import("../pages/discover/palylist/index.vue"),
            name: "palylist",
            meta: {
              name: "歌单",
            },
          },
        ],
      },
      {
        path: "friend",
        component: () => import("../pages/friend/index.vue"),
        name: "friend",
        meta: {
          name: "好友",
        },
      },
      {
        path: "mine",
        component: () => import("../pages/mine/index.vue"),
        name: "mine",
        meta: {
          name: "我的",
        },
      },
    ],
  },

  {
    path: "/login",
    component: () => import("../pages/login/index.vue"),
    name: "login",
    meta: {
      name: "登入",
    },
  },
];

const router = createRouter({
  history: createWebHashHistory(),

  routes,
});

export default router;
